import { axios } from '@/utils/request'

/**
 * 查询文件存储列表
 * @param query
 * @returns {*}
 */
export function pageFile(query) {
  return axios({
    url: '/file/page',
    method: 'get',
    params: query
  })
}

/**
 * 根据文件id获取多个文件信息
 * @param fileIds
 * @returns {*}
 */
export function getByFileId(fileIds) {
  return axios({
    url: '/file/getByFileId',
    method: 'get',
    params: {fileIds:fileIds}
  })
}

/**
 * 根据文件url获取多个文件信息
 * @param fileUrls
 * @returns {*}
 */
export function getBytesByUrl(fileUrls) {
  return axios({
    url: '/file/getBytesByUrl',
    method: 'get',
    params: {urls:fileUrls}
  })
}

/**
 * 删除文件
 * @param fileIds
 * @returns {*}
 */
export function delFile(fileIds) {
  return axios({
    url: '/file/deleteByFileId',
    method: 'delete',
    params: {fileIds:fileIds}
  })
}

/**
 * 清理系统文件
 * @param fileIds
 * @returns {*}
 */
export function clearFile(tableName, fileIdFiled, isDelFiled) {
  return axios({
    url: '/file/clearFile',
    method: 'get',
    params: {tableName,fileIdFiled,isDelFiled}
  })
}

